using System;
using System.Collections.Generic;
using System.Text;

namespace NBusiness.Data
{
    [Serializable]
	public class AuthorizationRule
	{
        public AuthorizationRule()
        { }
        public AuthorizationRule(Type entityType, AuthorizationRuleType type, string role)
            : this(entityType, type, role, true)
        { }
        public AuthorizationRule(Type entityType, AuthorizationRuleType type, string role, bool allow)
        {
            _entityType = entityType;
            _type = type;
            _role = role;
            _allow = allow;
        }

        private Type _entityType;
        public Type EntityType
        {
            get { return _entityType; }
            set { _entityType = value; }
        }

		private bool _allow = true;
		public bool Allow
		{
			get { return _allow; }
			set { _allow = value; }
		}

		private string _role;
		public string Role
		{
			get { return _role; }
			set { _role = value; }
		}

		private AuthorizationRuleType _type = AuthorizationRuleType.Insert;
		public AuthorizationRuleType Type
		{
			get { return _type; }
			set { _type = value; }
		}
	}
}
